<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdn.bootcss.com/echarts/3.7.1/echarts.min.js"></script>
</head>
<style>
    *{
        margin: 0;
        padding: 0;
    }
    .w {
        width: 1200px;
        height: auto;
        margin: auto;
    }
    .box{
        height: 60px;
        margin-top: 30px;
        display: flex;
        justify-content: center;
    }
    .box input{
        width: 700px;
        height: 40px;
        border: 1px solid red;
        font-size: 26px;
        padding: 10px;

    }
    .box #btn{
        width: 60px;
        height: 60px;
        border: 1px solid cornflowerblue;
        cursor: pointer;
    }
    #data{
        height: 800px;
        margin-top: 30px;
        border: solid pink;
    }
    body{
        background: -webkit-repeating-linear-gradient(deepskyblue,pink);
    }

</style>
<!--搜索框-->
<body>
<div class="box w">
    <input id="tt" type="text" placeholder="请输入基金ID或名字" >
    <button onclick="send_data()" id="btn">搜索</button>
</div>
<!--数据展示框-->
<div  id="data" class="w" ></div>

</body>
<script src = '../static/xl.js'></script>
<script>
    send_data = function (){
       var text = $('.box input').val();
       Data = {'data':text};
        $.ajax({
            url:'/ff',
            type:'GET',
            data:Data,
            success:function (res){
                if (res.success == 0){
                    option.xAxis.data = res.data.time;
                    option.series[0].data = res.data.price;
                    option.title.text = res.data.title;
                    ff.setOption(option)
                }else{
                    alert('输入有误',)
                }
            },
            error:function (){
                alert('有错误后面再调试')
            }
        })
    };
    // $('#btn').click(send_data)
    <!--回车提交请求-->
    $("#tt").bind('keydown', function (event) {     // keydown 也可换成 keypress
    if (event.keyCode == "13") {
     $("#btn").click();
   }
  })
<!--以下代码页也可实现回车提交-->
// document.onkeydown = function(e){
//         if(!e) e = window.event;
//         if((e.keyCode || e.which) == 13){
//             document.getElementById("btn").click();
//         }
//  }
</script>
</html>